      *> File Name     000009_ClassLibrary.cbl.
      *> Description   Creating a .NET DLL.
      *> Project Type  Class Library.
      *> CodePlex URL  http://cobol.codeplex.com
 
      *> Config        Build this project as ClassLibrary.DLL. In later
      *>               examples, you'll reference and use this DLL from
      *>               COBOL and C#.
 
      *> Comments      Note the use of a namespace to qualify type names,
      *>               e.g., Person as "ClassLibrary.Person".
       
       class-id.     Person as "ClassLibrary.Person".
       repository.
           enum genders as "ClassLibrary.Genders"
           .
       static.
       working-storage section.
       01  _headCount  binary-long protected.
      *>
       method-id.    get property HeadCount.
       procedure division giving n as binary-long.
           move _headCount to n.
       end method.
      *>
       end static.
      *>
       object.
       working-storage section.
       01  _firstName  string.
       01  _lastName   string.
       01  _sex        genders.
       01  _age        binary-long.
      *>
       method-id.    New.
       linkage section.
       01  firstName  string.
       01  lastName   string.
       01  sex        genders.
       01  age        binary-long.
       procedure division using by value firstName, lastName, sex, age.
           move firstName to _firstName
           move lastName  to _lastName
           move sex       to _sex
           move age       to _age
           add 1 to _headcount
           .
       end method    New.
      *>
       method-id.    get property FirstName.
       procedure division giving s as string.
           move _firstName to s.
       end method.
      *>
       method-id.    get property LastName.
       procedure division giving s as string.
           move _lastName to s.
       end method.
      *>
       method-id.    get property Gender.
       procedure division giving e as genders.
           move _sex to e.
       end method.
      *>
       method-id.    get property Age.
       procedure division giving n as binary-long.
           move _age to n.
       end method.
      *>
       method-id.    ToString override.
       procedure division giving s as string.
           move string::"Format"("{0} {1}, {2}, age {3}.",
               _firstName, _lastName, _sex, _age) to s.
       end method  ToString.
      *>
       end object.
       end class     Person.
 
       enum-id.    Genders as "ClassLibrary.Genders".
       working-storage section.
       01  binary-long.
       78  Male.
       78  Female.
       end enum    Genders.